package com.framework.core.api.feign;

import com.framework.common.constant.ServiceNameConstants;
import com.framework.core.api.feign.factory.RemoteWeixinFallbackFactory;
import com.framework.core.api.response.WxUserOpenIdRes;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author zhoubb
 * @version V1.0
 * @Date 2020/4/12 23:07
 * @since JDK 1.8
 */
@FeignClient(name = ServiceNameConstants.SERVICE_CORE, fallbackFactory = RemoteWeixinFallbackFactory.class)
public interface RemoteWeixinService {

    @GetMapping("wx/getUser")
    public WxUserOpenIdRes getWeixinOpenidAndKey(@RequestParam(value = "code") String code);

    @GetMapping("wx/getPhoneNumber")
    public String getPhoneNumberFromWeixin(@RequestParam(value = "encryptedData") String encryptedData,
                                           @RequestParam(value = "sessionKey") String sessionKey,
                                           @RequestParam(value = "iv") String iv);
}
